package com.example.baiduapi.serviceListener.old.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.example.baiduapi.domain.AjaxResult;
import com.example.baiduapi.serviceListener.old.service.MvcService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service("MvcService3")
@Slf4j
//public class MvcService3 implements MvcService, BeanNameAware {
public class MvcService3 implements MvcService {

    @Override
    public AjaxResult mvcFunction(JSONObject params) {
        log.info("OldMvcService3参数为：{}",params);
        HashMap<Object, Object> result = new HashMap<>();
        result.put("beanPath",this.getClass().getName());
        result.put("params",params);
        return AjaxResult.success("获取成功",result);
    }

    @Override
    public String getName(){
        return "MvcService3";
    }
/*    @Override
    public String getName() {
        this.beanName = beanName; // Spring 会自动调用这个方法
        return beanName;
    }

    private String beanName;
    @Override
    public void setBeanName(String name) {
        this.beanName = name; // Spring 会自动调用这个方法
    }*/
}
